package a13waitandnotify;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86131
 * Date: 2024-04-17
 * Time: 16:02
 */
public class ThreadDemo {
    /*
    * 需求:完成生产者和消费者(等待唤醒机制)的代码
    *     实现线程轮流交替执行的效果
    * */
    public static void main(String[] args) {
        //创建线程对象
        Cook c = new Cook();
        Foodie f = new Foodie();

        //给线程设置名字
        c.setName("厨师");
        f.setName("吃货");

        //开启线程
        c.start();
        f.start();
    }
}
